Using Forms to Collect Name Information
If you want to use different names each time you run the sample automation, manually adjusting the MyFirstName
and MyLastName
variable tasks would rebuild the automation each time, but it would also be highly inefficient. As a solution, it would be far better to leave the automation "as is" and simply provide the name values when you run the automation. To accomplish this, you will need to use a JSON Form.
Likewise, running the automation from Automation Studio every time would not only be tedious but also require manual alterations that could unwittingly open the door to automation errors. To avoid this scenario, you will need to kick off the automation via JSON Form using Automation Catalog.
The docs.itential.com site contains more detailed user guides specific to Automation Catalog and JSON Forms
Access Automation Catalog
From the IAP home page:
Click the Automation Catalog tile. The main page displays.
Click + CREATE AN AUTOMATION.
Note: The "automation" terminology used here is somewhat of a misnomer. You won't actually be creating an automation as you did in Automation Studio. Instead you'll be providing access to an automation that's already built.
Give your automation the name "GenerateFacts".
Optionally provide a description.
Click the CREATE button.
In the GenerateFacts Automation Catalog window:
- Select the "EnlightenMe" automation from the Automation list.
- Click SAVE (lower-left corner).
- Under the Form list, click the + NEW FORM button.
- A pop-up message may display asking you to confirm if you want to leave the site.
- Accept the prompt. Doing so will open the JSON Form Builder.
Create a JSON Form
To create your JSON Form:
- Go to the upper-left corner of the canvas.
- For the Form name, add "GenFacts".
- Click the CREATE button that appears under the name field.
- Click the SAVE button that appears after you create the form.
- Go the list of Form Elements on the right side.
- Click and drag the TEXT INPUT element onto the canvas.
- Click the cog icon to the right of TEXT INPUT.
- Label the text element "FirstName".
- Select "Yes" under the Required setting to make the "FirstName" label a required field.
- Click SAVE.
- Add another TEXT INPUT element and label it "LastName".
- Make the "LastName" label a required field.
- Click SAVE.
- Click GO BACK TO AUTOMATION CATALOG at the bottom of the form.
Figure 1. JSON Form
For more information on building forms, refer to the JSON Forms user guide on the docs.itential.com site.
Save the JSON Form
Once you build the JSON Form, you will return to the Automation Catalog entry "GenerateFacts" that was started earlier.
- In the Form list, select the "GenFacts" form you created.
- Click SAVE.
Now let's take a moment and do a checkpoint.
So far, you have created an Automation Catalog entry that will display a newly built "GenFacts" form. Next, you will need to send the form values to the "EnlightenMe" automation, but keep in mind, the automation isn't expecting to receive input from a form. In this part of the process, you will need to update the automation to use the entry values from the JSON Form instead of the "New Variable" tasks -- MyFirstName
and MyLastName
.
Update the Automation to Accept Form Inputs
To update the automation:
Click the App Grid icon in the header toolbar.
Figure 2. App Grid
Select "Automation Studio" from the list.
Click the "Find Automation" option (center of screen).
Find the "EnlightenMe" automation tile.
Click the menu icon (lower-right corner of the tile).
Select Edit.
Figure 3. Edit Automation
You are now back on the familiar Automation Builder canvas.
Set the Query Tasks
At this point, you will need to switch out the task data for "MyFirstName" and "MyLastName". The intent here is to consume the information from the GenFacts
form instead of the hard-coded values contained in the "New Job Variable" tasks.
Click the "MyFirstName" task.
Click the Delete button, or the trashcan icon (upper-right corner) on the canvas, to delete the task.
Repeat the previous step for the "MyLastName" task. Your canvas is now missing two necessary variables.
In the Task Menu Sidebar, search for "Query".
Add two Query tasks to the canvas (to replace the tasks just deleted).
Add a transition from the FactURL to one of the new Query tasks.
Double-click the Query task to edit the properties.
Change the Summary to "Form-FirstName".
Change the Description to a short comment that will make sense in the canvas tooltip. For example: "Isolate FirstName from form".
The tool tip description should be clear and give the user a hint as to the purpose of that specific task.
Set the
pass_on_null
Reference task variable to "False".Set the
query
Reference task variable to "firstName", which is the name of the field in the JSON Form you created.For compliance purposes, the "FirstName" field label on the "GenFacts" form is automatically converted to camelCase, making it
firstName
instead.
Change the Object Variable
You will need to change the obj
variable manually:
- Change the Reference task to
job
. - For the Reference variable, click the EDIT button.
- Manually type the word "formData" (without quotes and case-senstive).
- Click outside of the text entry box when finished.
- Click SAVE to return to the canvas.
The first Query task is now configured to understand that it will be obtaining content from a JSON form. Now let's move on to the second Query task.
Add a transition from the "Form-FirstName" query task that was just altered to the second Query task you added.
Configure the second Query task to be "Form-LastName".
This
query
variable will search forlastName
. Remember, the "LastName" field label is converted to camelCase on the "GenFacts" form.Set the
pass_on_null
variable to "False".Notice that
formData
is now an option in the job variable list forobj
. Select it from the list.Add a transition from the "Form-LastName" query task to the FirstName-Update (replace) task.
You should now have a series of nine workflow tasks on the canvas.
START
FactURL
Form-FirstName
(Query)Form-LastName
(Query)FirstName-Update
LastName-Update
FetchFact
Query
(IsolateFact)END
Figure 4. Workflow Tasks
Update the Replace Tasks
Next, you will need to update the replace tasks to consume and work with the form values collected in the Query tasks you added.
- Update the Firstname-Update task properties:
- Set the
newSubstr
Reference task variable to the "Form-FirstName" task. - The Reference variable should automatically change to
return_data
.
- Set the
- Click Save.
- Update the Lastname-Update task properties:
- Set the
newSubstr
variable Reference task to the "Form-LastName" task. - The Reference variable should automatically change to
return_data
.
- Set the
- Click Save.
Note: After updating all the tasks, you could try to manually run the automation, but it will likely result in an error. This is because the automation is now expecting input from a JSON form; however, up until now you have not directly indicated "what form" the automation should expect input values from. You'll recall that the form name was specified within the "GenerateFacts" entry in Automation Catalog.
Test Run the Automation Catalog Entry
At this point, you should have saved the entire automation.
Click the App Grid icon in the header toolbar.
Select "Automation Catalog" from the list of options.
Click Find Automation.
Find the "GenerateFacts" automation tile.
Click the Play icon (lower-right corner).
The "GenFacts" form displays in a modal window.
Provide
FirstName
andLastName
values.Click START (lower-left corner). The modal window is replaced with a Run Automation notification window.
Figure 5. Notification Message
Click the VIEW JOB button to open the Job Manager page.
Find the IsolateFact task in the job list.
Click the book icon to view the OUTGOING value.
You should observe that "Chuck Norris" has been replaced by whatever name input you gave in the "GenerateFacts" Automation (form) initiated from Automation Catalog.
Summary Wrap-Up
Kudos, what great work you've done! You completed all the sections of this quick start tour from start to finish. Let's review all that you've accomplished on your journey:
- Created an automation that utilizes tasks to obtain data from a remote system.
- Viewed active jobs in Job Manager and navigate to the Outgoing tab to view task results.
- Used additional task inputs that interacted with values presented by other tasks in the automation.
- Customized an automation to accept user input.
- Created an Automation Catalog entry that uses a custom JSON Form to obtain input that's passed to an automation.
After completing this guide, you should be well on your way to using all the the basic capabilities of your IAP instance. To expand your knowledge further, refer to the Itential Automation Platform User Guides provided on the docs.itential.com site for more detailed information.